package app;

public class App {

    public static void main(String[] args) {
        String s = "hellosweetlittleworld";
        int[] chars = new int[27];
        for (int i = 0; i < s.length(); i++) {
            chars[(int) s.charAt(i) - 97]++;
        }
        for (int i = 0; i < chars.length; i++) {
            System.out.print(chars[i] != 0 ? (char) (i + 97) + "-" + chars[i] + ", ": "");
        }
    }
}
